package com.edu.xuanxuan;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;

import com.jizhang.BaseAction;

import io.appium.java_client.android.AndroidDriver;

public class BaseTest {
	
	public AndroidDriver driver;
	public BaseAction action;
	@BeforeClass
	public void initDriver() throws Exception {
		URL url = new URL("http://127.0.0.1:4723/wd/hub");
//		File file = new File("./apps//todolist.apk");
		DesiredCapabilities cap = new DesiredCapabilities();
		cap.setCapability("platformName", "Android");
		cap.setCapability("deviceName", "127.0.0.1:62001");
		cap.setCapability("noReset", true);
		
		//喧喧
		cap.setCapability("appPackage", "com.cnezsoft.xxm");
		cap.setCapability("appActivity", ".MainActivity");
		
		//yibijizhang
//		cap.setCapability("appPackage", "com.mobivans.onestrokecharge");
//		cap.setCapability("appActivity", ".activitys.BootActivity");

//		System.out.println(file.getAbsolutePath());
		//安装apk
//		cap.setCapability("app", file.getAbsolutePath());
		//是否重置应用，是否保留历史数据
		
//		//todolist
//		cap.setCapability("appPackage", "com.example.todolist");
//		cap.setCapability("appActivity", ".LoginActivity");
		
		//notes
//		cap.setCapability("noReset", true);
//		cap.setCapability("appPackage", "com.example.android.notepad");
//		cap.setCapability("appActivity", ".NotesList");
		
		//demolsv
//		cap.setCapability("appPackage", "com.android.demodslv");
//		cap.setCapability("appActivity", ".TestBedDSLV");
		
		//apiDemo
//		cap.setCapability("appPackage", "io.appium.android.apis");
//		cap.setCapability("appActivity", ".ApiDemos");

		driver = new AndroidDriver(url, cap);

	}
	
//	@Test
//	public void quit() {
//		driver.quit();
//	}

}


